<template class="add-member-pop">
	<view @click="addMemberPopDismiss">
		<view v-if="dataSource&&dataSource.id" class="pop-parent">
			  <view v-if="!dataSource.F_id&&dataSource.is_spouse==0" class="fuqin-view" @click="itemClick" data-item="0">
				  <image class="item-img" src="../../static/fan_png_person_blue.png" mode="aspectFill"></image>
				  <text class="item-txt">父亲</text>
			  </view>
			  <view v-if="!dataSource.M_id&&dataSource.is_spouse==0" class="muqin-view" @click="itemClick"  data-item="1">
					<image class="item-img" src="../../static/fan_png_person_red.png" mode="aspectFill"></image>
					<text class="item-txt">母亲</text>
			  </view>
			  <view  v-if="!dataSource.spouse_val.id&&dataSource.is_spouse==0"
			   class="qizi-view"  @click="itemClick"  :data-item="dataSource.gender==1?'2':'-1'">
					<image v-if="dataSource.gender==1" class="item-img" src="../../static/fan_png_person_red.png" mode="aspectFill"></image>
					<image v-else class="item-img" src="../../static/fan_png_person_blue.png" mode="aspectFill"></image>
					<text  v-if="dataSource.gender==1" class="item-txt">妻子</text>
					<text v-else class="item-txt">丈夫</text>
			  </view>
			  <view v-if="dataSource.shi!=1&&dataSource.is_spouse==0" class="xiong-view"  @click="itemClick"  data-item="3">
					<image class="item-img" src="../../static/fan_png_person_blue.png" mode="aspectFill"></image>
					<text class="item-txt">兄</text>
			  </view>
			  <view v-if="dataSource.shi!=1&&dataSource.is_spouse==0" class="di-view"  @click="itemClick"  data-item="4">
					<image class="item-img" src="../../static/fan_png_person_blue.png" mode="aspectFill"></image>
					<text class="item-txt">弟</text>
			  </view>
			  <view v-if="dataSource.shi!=1&&dataSource.is_spouse==0" class="jie-view"  @click="itemClick"  data-item="5">
					<image class="item-img" src="../../static/fan_png_person_red.png" mode="aspectFill"></image>
					<text class="item-txt">姐</text>
			  </view>
			  <view v-if="dataSource.shi!=1&&dataSource.is_spouse==0" class="mei-view"  @click="itemClick"  data-item="6">
					<image class="item-img" src="../../static/fan_png_person_red.png" mode="aspectFill"></image>
					<text class="item-txt">妹</text>
			  </view>
			  <view class="erzi-view"  @click="itemClick"  data-item="7">
					<image class="item-img" src="../../static/fan_png_person_blue.png" mode="aspectFill"></image>
					<text class="item-txt">儿子</text>
			  </view>
			  <view class="nver-view"  @click="itemClick"  data-item="8">
					<image class="item-img" src="../../static/fan_png_person_red.png" mode="aspectFill"></image>
					<text class="item-txt">女儿</text>
			  </view>
			  <view class="center-view">
				  <text class="center-item-text">为</text>
				  <text class="item-name">{{dataSource.surname+dataSource.name}}</text>
				  <text class="center-item-text">添加</text>
			  </view>
		</view>
		<view v-else class="new-member-view">
			 <text class="new-member-tip">请选择性别</text>
			 <view style="display: flex;flex-direction: row;margin-top: 74rpx;">
				<view class="mam-view" @click="itemClick"  data-item="9">
					<image class="item-img" src="../../static/fan_png_person_blue.png" mode="aspectFill"
					style="width: 109rpx;height: 144rpx;"></image>
					<text class="item-txt" style="font-size: 39rpx;line-height: 30rpx;margin-top: 13rpx;">男</text>
				</view>
				<view class="womam-view" @click="itemClick"  data-item="10" style="margin-left: 43rpx;">
					<image class="item-img" src="../../static/fan_png_person_red.png" mode="aspectFill"
					style="width: 109rpx;height: 144rpx;"></image>
					<text class="item-txt" style="font-size: 39rpx;line-height: 30rpx;margin-top: 13rpx;">女</text>
				</view>
			 </view>
		</view>
	</view>
</template>

<script>
	var WxNotificationCenter = require('../tree-view/WxNotificationCenter.js');
	export default {
		name: "add-member-pop",
		data() {
			return {
				
			}
		},
		props: {
			dataSource: {
				type: Object
			},
		},
		methods: {
			///点击用户
			itemClick(e) {
				let item = e.currentTarget.dataset.item;
				///回调事件
				WxNotificationCenter.postNotificationName('NOTI_ADDTREEMEMBERCLICK', item);
			},
			addMemberPopDismiss() {
				///回调事件
				WxNotificationCenter.postNotificationName('NOTI_ADDPOPDISMISS');
			},
		}
	}
</script>

<style>
	@import "add-members-pop.css";
</style>
